import tkinter
from tkinter.messagebox import showinfo
import windnd
import pandas
import os

def dragged_files(files):
    # msg = '\n'.join((item.decode('gbk') for item in files))
    msg = f'dragged {len(files)} files'
    # showinfo('dragged files are', msg)
    showinfo('dragged files are', msg)
    # showinfo(f'dragged {len(files)} files')
    filelist =[]
    for item in files:
        filelist.append(item.decode('gbk'))
    print('filelist:', filelist)
    print('isfile: ', openfile(filelist[0]))
    return filelist

def openfile(filename):
    return os.path.isfile(filename)

tk = tkinter.Tk()
windnd.hook_dropfiles(tk, func=dragged_files)
tk.mainloop()